/*
 *
 * {{properCase name }}
 *
 */

import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
{{#if wantHeaders}}
import { Helmet } from 'react-helmet';
{{/if}}
{{#if wantMessages}}
import { FormattedMessage } from 'react-intl';
{{/if}}
{{#if wantActionsAndReducer}}
import { createStructuredSelector } from 'reselect';
import makeSelect{{properCase name}} from './selectors';
{{/if}}
{{#if wantMessages}}
import messages from './messages';
{{/if}}

/* eslint-disable react/prefer-stateless-function */
export class {{ properCase name }} extends React.{{{ component }}} {
  render() {
    return (
      <div>
      {{#if wantHeaders}}
        <Helmet>
          <title>{{properCase name}}</title>
          <meta
            name="description"
            content="Description of {{properCase name}}"
          />
        </Helmet>
      {{/if}}
      {{#if wantMessages}}
        <FormattedMessage {...messages.header} />
      {{/if}}
      </div>
    );
  }
}

{{ properCase name }}.propTypes = {
  dispatch: PropTypes.func.isRequired,
};

{{#if wantActionsAndReducer}}
const mapStateToProps = createStructuredSelector({
  {{camelCase name}}: makeSelect{{properCase name}}(),
});
{{/if}}

function mapDispatchToProps(dispatch) {
  return {
    dispatch,
  };
}

{{#if wantActionsAndReducer}}
export default connect(mapStateToProps, mapDispatchToProps)({{ properCase name }});
{{else}}
export default connect(null, mapDispatchToProps)({{ properCase name }});
{{/if}}
